package com.shanshui.webtest;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.FrameLayout;

public class MainActivity extends AppCompatActivity {
    private MyWebView mMyWebView;
    private FrameLayout mContent;
    private Button mButton2;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
//        mMyWebView = findViewById(R.id.myWebView);
        mContent = findViewById(R.id.content);
        mButton2 = findViewById(R.id.button2);

        MyWebView mLocalWebView = new MyWebView(this);
        mContent.addView(mLocalWebView, 0, new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
        mLocalWebView.loadUrl("http://8.134.38.88:3003/#/termsCondition");
        mButton2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
//                MyWebView waddle = new MyWebView(MainActivity.this);
                mContent.addView(mLocalWebView, 0, new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
//                waddle.loadUrl("http://8.134.38.88:3003/#/termsCondition");
                mLocalWebView.reload();
            }
        });
    }
}